package com.knowledgepoint.study.config.mybatis;

import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import java.util.List;

/**
 * 自定义 SQL 注入器
 */
public class MySqlInjector extends DefaultSqlInjector {
    
    @Override
    public List<AbstractMethod> getMethodList(Class<?> mapperClass, TableInfo tableInfo) {
        // 获取父类中的方法列表
        List<AbstractMethod> methodList = super.getMethodList(mapperClass, tableInfo);
        
        // 添加自定义的物理删除方法
        methodList.add(new PhysicalDeleteById());
        methodList.add(new PhysicalDeleteBatchByIds());
        methodList.add(new PhysicalDeleteByMap());
        
        return methodList;
    }
}
